import { defineStore } from "pinia";
import { Names } from "./storeKey"
type GlobalData = {
    width: number,
    height: number,
    nickName: string,
    role: string,
    uid: string,
}    
export const useGlobalData = defineStore(Names.UseGlobalData, {
    persist: {
        enabled: true,
        strategies: [
            {
                key: 'userInfoState',
                storage:localStorage,
            }
        ]
    },
    state: () => (<GlobalData>{
        width: 0,
        height: 0,
        nickName: "",
        role: "",
        uid: "",
    })
})